﻿<Window x:Class="DTC.Popups.DrugPopup"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Valid="clr-namespace:DTC.Validations"
    Title="Препарат" Height="360" Width="350" 
        Style="{StaticResource PopupWindow}" 
        Closing="Window_Closing"
        Loaded="Window_Loaded">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/Brushes.xaml"/>
                <ResourceDictionary Source="../Resources/TextEditStyles.xaml"/>
				<ResourceDictionary Source="../Resources/TextBlockStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
	<StackPanel Name="MainGrid" Margin="10" VerticalAlignment="Center" 
                HorizontalAlignment="Center"
                >
        <StackPanel VerticalAlignment="Center" HorizontalAlignment="Stretch">
            <TextBlock Foreground="{StaticResource MarkingFontColor}"
            	     Text="Название препарата: "/>
        	<TextBox Name="DrugNameTextBox"
                     Margin="0,10,0,0"
                     Width="220">
					<TextBox.Text>
						<Binding Path="Name" Mode="TwoWay" NotifyOnValidationError="True"
                                 UpdateSourceTrigger="PropertyChanged">
							<Binding.ValidationRules>
							    <Valid:EmptyValidate/>
							</Binding.ValidationRules>
						</Binding>
					</TextBox.Text>
			</TextBox>            
    	</StackPanel>
        <TextBlock Text="Описание препарата:"
                   Margin="0,17,0,0"/>
        <TextBox Height="120" Width="250"
                 Name="DescriptionTextBox"
                 Text="{Binding Path=Description}"
				 BorderThickness="1"
                 Margin="5,12,0,0" 
				 TextWrapping="Wrap"
				 AcceptsReturn="True"
				 AcceptsTab="True"
				 AutoWordSelection="True"
				 VerticalContentAlignment="Top">
        	<TextBox.BorderBrush>

        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        			<GradientStop Color="#FF434343" Offset="0.5"/>
        			<GradientStop Color="#FF828282" Offset="1"/>
        			<GradientStop Color="#FF8C8C8C"/>
        		</LinearGradientBrush>
        	</TextBox.BorderBrush>
        </TextBox>
	</StackPanel>
</Window>
